<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/params.php')
);

return [
    'id' => 'gsz-backend',
    'name'  => 'gsz backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'runtimePath' => RUNTIME_PATH,
    'bootstrap' => ['log'],
    'language'=>'zh-CN',
    'vendorPath' => '@app/../vendor',
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@app/node_modules',
        '@admin' => '@app/modules/admin',
        '@xuguoliangjj/editorgridview' => '@vendor/xuguoliangjj/yii2-editorgridview',
    ],
    'modules' => [
        'admin' => [
            'class' => 'backend\modules\admin\Module',
        ]
    ],
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-backend',
            'cookieValidationKey' => 'gsz456back&*123%',
        ],
        'user' => [
            'identityClass' => 'backend\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
        ],
        'authManager' => [
            'class' => 'yii\rbac\DbManager'
        ],
        'session' => [
            // this is the name of the session cookie used for login on the backend
            'name' => 'advanced-backend',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                'error' => [
                    'logFile' => '@runtime/logs/admin.error.log',
                ],
                'warning' => [
                    'logFile' => '@runtime/logs/admin.warning.log',
                ],
                'info' => [
                    'logFile' => '@runtime/logs/admin.info.log',
                ]
            ],
        ],
//        'errorHandler' => [
//            'errorAction' => 'site/error',
//        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
    ],
    'params' => $params,
];
